<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>lkx考研倒计时专用</title>
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="/css/jsdaima.com.css">
    <link rel="stylesheet" type="text/css" href="/css/layui.css">
    <link rel="stylesheet" type="text/css" href="/css/dropload.css">
</head>
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="/js/protect.js"></script>

<style>
    .word{
        font-size: 30px;
        color: #ff0000;
        margin-top: 6px;
    }
    .lkx{
        font-size: 35px;
        color: #06b109;
    }
</style>
<body style="background-color: #0c8d9bfa;">
    <div class="container" style="height: 100%;margin-top: 25px;">
        <div style="width: 100%;position: fixed;top: 0;z-index: 8;background-color: #fff;border-bottom: solid 3px #183059;">
            <audio autoplay="" loop=""><source src="/music/abc.mp3"></audio>
            <div style="height: 60px;width: 100%;">
                <marquee direction="left" scrollamount="5" width="100%" height="60px" bgcolor="#fff" hspace="0" vspace="0">
                    <p class="word">考研倒计时   本站是为了鼓励<span class="lkx">小可er同学</span>以及像小可一样坚持在考研路上的同学，欢迎来留言！！！</p>
                </marquee>
            </div>
            <div id="timer"></div>
            <br>
            <div><a href="/index/Index/message" class="layui-btn" style="width: 92%;margin-left: 4%;">留言鼓励</a></div>
            <br>
        </div>
        <!--// 弹幕位置-->
        <div class="ctxt"></div>
        <div class="box inner" style="margin-top: 200px;">
            <div class="layui-card" style="margin: 0 4%;" class="gethtml">
                <div class="layui-card-header">
                    <span>[name]</span>
                    <span style="float:right;">[add_time]</span>
                </div>
                <div class="layui-card-body">[comment]</div>
            </div>
            <br>
        </div>
    </div>

</body>
<script src="/js/dropload.min.js"></script>
<script src="/js/string.js"></script>
<script>
    var page = 1;
    var str = $(".box").html();
    // var str = $(".box").prop("outerHTML");
    var url = '/index/Index/getComment';
    $(function(){
        $('.box').empty();
        lazy_loding(url,page);
    });

    function row_replace(list){
        var str1 = '';
        for(var i = 0,len = list.length;i < len;i++ ){
            str1 += str_replace(str,{
                name:list[i]['name']?list[i]['name']:'匿名者',
                add_time:formatUnixtimestamp(list[i]['add_time']),
                comment:list[i]['comment']
            });
        }
        return str1;
    }

    function lazy_loding(url,page) {
        var dropload = $('.container').dropload({
            scrollArea : window,
            domDown: {
                domClass: 'dropload-down',
                domRefresh: '<div class="dropload-refresh">↑上拉加载更多</div>',
                domLoad: '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
                domNoData: '<div class="dropload-noData">暂无数据</div>'
            },
            loadDownFn: function(me) {
                $.ajax({
                    type: 'POST',
                    url: url,
                    data:{page:page},
                    success: function(data) {
                        var str = '';
                        if(data.length == 0){
                            me.lock();
                            me.noData();
                        }
                        else{
                            str = row_replace(data);
                        }

                        $('.box').append(str);
                        // 每次数据加载完，必须重置
                        dropload.resetload();
                        page++;
                    },
                    error: function(xhr, type) {
                        alert('Ajax error!');
                        // 即使加载出错，也得重置
                        dropload.resetload();
                    }
                });
            }
        });
    }
</script>
</html>